<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="container">
        <h2>v-show</h2>
        <div v-show="flag">
            <input type="button" value="登录">
            <input type="button" value="注册">
        </div>
        <div v-show="!flag">
            <p>{{str}}({{sum}})</p>
        </div>
        <h2>v-if</h2>
        <div v-if="flag">
            <input type="button" value="登录">
            <input type="button" value="注册">
        </div>
        <div v-if="!flag">
            <p>{{str}}({{sum}})</p>
        </div>
        <h2>v-if&v-else-if&v-else</h2>
        <p v-if="num>10">大于10</p>
        <p v-else>小于或等于10</p>
        <hr>
        <p v-if="num>10">大于10</p>
        <p v-else-if="num==10">等于10</p>
        <p v-else>小于10</p>
        <hr>
        <p v-if="num>10">大于10</p>
        <p v-if="num==10">等于10</p>
        <p v-if="num<10">小于10</p>
    </div>
    <script>
        new Vue({
            el:"#container",
            data:{
                flag:true,
                str:"欢迎xxx登录网站!您当前账号余额为",
                sum:100.23,
                num:10
            }
        })
    </script>
</body>
</html>